<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>JSDoc: Class: PDFDocumentProxy</title>

    <script src="scripts/prettify/prettify.js"> </script>
    <script src="scripts/prettify/lang-css.js"> </script>
    <!--[if lt IE 9]>
      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>

<body>

<div id="main">

    <h1 class="page-title">Class: PDFDocumentProxy</h1>

    




<section>

<header>
    
        <h2><span class="attribs"><span class="type-signature"></span></span>
            <span class="ancestors"><a href="module-pdfjsLib.html">pdfjsLib</a>~</span>PDFDocumentProxy<span class="signature">()</span><span class="type-signature"></span></h2>
        
            <div class="class-description">Proxy to a PDFDocument in the worker thread. Also, contains commonly used
properties that can be read synchronously.</div>
        
    
</header>

<article>
    <div class="container-overview">
    
        

    
    <h2>Constructor</h2>
    

    
    <h4 class="name" id="PDFDocumentProxy"><span class="type-signature"></span>new PDFDocumentProxy<span class="signature">()</span><span class="type-signature"></span></h4>
    

    















<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="display_api.js.html">display/api.js</a>, <a href="display_api.js.html#line589">line 589</a>
    </li></ul></dd>
    

    

    

    
</dl>




















    
    </div>

    

    

    

    

    

    

    
        <h3 class="subsection-title">Members</h3>

        
            
<h4 class="name" id="fingerprint"><span class="type-signature"></span>fingerprint<span class="type-signature"> :string</span></h4>




<div class="description">
    A (not guaranteed to be) unique ID to identify a PDF.
</div>



    <h5>Type:</h5>
    <ul>
        <li>
            
<span class="param-type">string</span>


        </li>
    </ul>





<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="display_api.js.html">display/api.js</a>, <a href="display_api.js.html#line604">line 604</a>
    </li></ul></dd>
    

    

    

    
</dl>






        
            
<h4 class="name" id="loadingParams"><span class="type-signature"></span>loadingParams<span class="type-signature"> :Object</span></h4>




<div class="description">
    A subset of the current {DocumentInitParameters}, which are  either needed in the viewer and/or whose default values may be affected  by the `apiCompatibilityParams`.
</div>



    <h5>Type:</h5>
    <ul>
        <li>
            
<span class="param-type">Object</span>


        </li>
    </ul>





<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="display_api.js.html">display/api.js</a>, <a href="display_api.js.html#line788">line 788</a>
    </li></ul></dd>
    

    

    

    
</dl>






        
            
<h4 class="name" id="loadingTask"><span class="type-signature"></span>loadingTask<span class="type-signature"> :PDFDocumentLoadingTask</span></h4>




<div class="description">
    The loadingTask for the current document.
</div>



    <h5>Type:</h5>
    <ul>
        <li>
            
<span class="param-type">PDFDocumentLoadingTask</span>


        </li>
    </ul>





<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="display_api.js.html">display/api.js</a>, <a href="display_api.js.html#line795">line 795</a>
    </li></ul></dd>
    

    

    

    
</dl>






        
            
<h4 class="name" id="numPages"><span class="type-signature"></span>numPages<span class="type-signature"> :number</span></h4>




<div class="description">
    Total number of pages the PDF contains.
</div>



    <h5>Type:</h5>
    <ul>
        <li>
            
<span class="param-type">number</span>


        </li>
    </ul>





<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="display_api.js.html">display/api.js</a>, <a href="display_api.js.html#line597">line 597</a>
    </li></ul></dd>
    

    

    

    
</dl>






        
    

    
        <h3 class="subsection-title">Methods</h3>

        
            

    

    
    <h4 class="name" id="cleanup"><span class="type-signature"></span>cleanup<span class="signature">()</span><span class="type-signature"></span></h4>
    

    



<div class="description">
    Cleans up resources allocated by the document, e.g. created `@font-face`.
</div>













<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="display_api.js.html">display/api.js</a>, <a href="display_api.js.html#line772">line 772</a>
    </li></ul></dd>
    

    

    

    
</dl>




















        
            

    

    
    <h4 class="name" id="destroy"><span class="type-signature"></span>destroy<span class="signature">()</span><span class="type-signature"></span></h4>
    

    



<div class="description">
    Destroys the current document instance and terminates the worker.
</div>













<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="display_api.js.html">display/api.js</a>, <a href="display_api.js.html#line779">line 779</a>
    </li></ul></dd>
    

    

    

    
</dl>




















        
            

    

    
    <h4 class="name" id="getAttachments"><span class="type-signature"></span>getAttachments<span class="signature">()</span><span class="type-signature"> &rarr; {Promise}</span></h4>
    

    















<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="display_api.js.html">display/api.js</a>, <a href="display_api.js.html#line691">line 691</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    A promise that is resolved with a lookup table for
  mapping named attachments to their content.
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Promise</span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id="getData"><span class="type-signature"></span>getData<span class="signature">()</span><span class="type-signature"> &rarr; {Promise}</span></h4>
    

    















<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="display_api.js.html">display/api.js</a>, <a href="display_api.js.html#line748">line 748</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    A promise that is resolved with a {TypedArray} that has
  the raw data from the PDF.
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Promise</span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id="getDestination"><span class="type-signature"></span>getDestination<span class="signature">(id)</span><span class="type-signature"> &rarr; {Promise}</span></h4>
    

    











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>id</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            

            

            <td class="description last">The named destination to get.</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="display_api.js.html">display/api.js</a>, <a href="display_api.js.html#line642">line 642</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    A promise that is resolved with all information
  of the given named destination.
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Promise</span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id="getDestinations"><span class="type-signature"></span>getDestinations<span class="signature">()</span><span class="type-signature"> &rarr; {Promise}</span></h4>
    

    















<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="display_api.js.html">display/api.js</a>, <a href="display_api.js.html#line633">line 633</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    A promise that is resolved with a lookup table for
  mapping named destinations to reference numbers.

This can be slow for large documents. Use `getDestination` instead.
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Promise</span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id="getDownloadInfo"><span class="type-signature"></span>getDownloadInfo<span class="signature">()</span><span class="type-signature"> &rarr; {Promise}</span></h4>
    

    















<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="display_api.js.html">display/api.js</a>, <a href="display_api.js.html#line757">line 757</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    A promise that is resolved when the document's data
  is loaded. It is resolved with an {Object} that contains the `length`
  property that indicates size of the PDF data in bytes.
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Promise</span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id="getJavaScript"><span class="type-signature"></span>getJavaScript<span class="signature">()</span><span class="type-signature"> &rarr; {Promise}</span></h4>
    

    















<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="display_api.js.html">display/api.js</a>, <a href="display_api.js.html#line699">line 699</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    A promise that is resolved with an {Array} of all the
  JavaScript strings in the name tree, or `null` if no JavaScript exists.
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Promise</span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id="getMetadata"><span class="type-signature"></span>getMetadata<span class="signature">()</span><span class="type-signature"> &rarr; {Promise}</span></h4>
    

    















<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="display_api.js.html">display/api.js</a>, <a href="display_api.js.html#line740">line 740</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    A promise that is resolved with an {Object} that has
  `info` and `metadata` properties. `info` is an {Object} filled with
  anything available in the information dictionary and similarly
  `metadata` is a {Metadata} object with information from the metadata
  section of the PDF.
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Promise</span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id="getOpenActionDestination"><span class="type-signature"></span>getOpenActionDestination<span class="signature">()</span><span class="type-signature"> &rarr; {Promise}</span></h4>
    

    















<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="display_api.js.html">display/api.js</a>, <a href="display_api.js.html#line683">line 683</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    A promise that is resolved with an {Array} containing
  the destination, or `null` when no open action is present in the PDF.
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Promise</span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id="getOutline"><span class="type-signature"></span>getOutline<span class="signature">()</span><span class="type-signature"> &rarr; {Promise}</span></h4>
    

    















<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="display_api.js.html">display/api.js</a>, <a href="display_api.js.html#line720">line 720</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    A promise that is resolved with an {Array} that is a
tree outline (if it has one) of the PDF. The tree is in the format of:
[
  {
    title: string,
    bold: boolean,
    italic: boolean,
    color: rgb Uint8ClampedArray,
    count: integer or undefined,
    dest: dest obj,
    url: string,
    items: array of more items like this
  },
  ...
]
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Promise</span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id="getPage"><span class="type-signature"></span>getPage<span class="signature">(pageNumber)</span><span class="type-signature"> &rarr; {Promise}</span></h4>
    

    











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>pageNumber</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>


            
            </td>

            

            

            <td class="description last">The page number to get. The first page is 1.</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="display_api.js.html">display/api.js</a>, <a href="display_api.js.html#line613">line 613</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    A promise that is resolved with a <a href="PDFPageProxy.html">PDFPageProxy</a>
  object.
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Promise</span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id="getPageIndex"><span class="type-signature"></span>getPageIndex<span class="signature">(ref)</span><span class="type-signature"> &rarr; {Promise}</span></h4>
    

    











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>ref</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            

            

            <td class="description last">The page reference. Must have
  the `num` and `gen` properties.</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="display_api.js.html">display/api.js</a>, <a href="display_api.js.html#line623">line 623</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    A promise that is resolved with the page index that is
  associated with the reference.
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Promise</span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id="getPageLabels"><span class="type-signature"></span>getPageLabels<span class="signature">()</span><span class="type-signature"> &rarr; {Promise}</span></h4>
    

    















<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="display_api.js.html">display/api.js</a>, <a href="display_api.js.html#line651">line 651</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    A promise that is resolved with an {Array} containing
  the page labels that correspond to the page indexes, or `null` when
  no page labels are present in the PDF file.
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Promise</span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id="getPageLayout"><span class="type-signature"></span>getPageLayout<span class="signature">()</span><span class="type-signature"> &rarr; {Promise}</span></h4>
    

    















<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="display_api.js.html">display/api.js</a>, <a href="display_api.js.html#line659">line 659</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    A promise that is resolved with a {string} containing
  the page layout name.
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Promise</span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id="getPageMode"><span class="type-signature"></span>getPageMode<span class="signature">()</span><span class="type-signature"> &rarr; {Promise}</span></h4>
    

    















<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="display_api.js.html">display/api.js</a>, <a href="display_api.js.html#line667">line 667</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    A promise that is resolved with a {string} containing
  the page mode name.
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Promise</span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id="getPermissions"><span class="type-signature"></span>getPermissions<span class="signature">()</span><span class="type-signature"> &rarr; {Promise}</span></h4>
    

    















<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="display_api.js.html">display/api.js</a>, <a href="display_api.js.html#line729">line 729</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    A promise that is resolved with an {Array} that contains
  the permission flags for the PDF document, or `null` when
  no permissions are present in the PDF file.
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Promise</span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id="getStats"><span class="type-signature"></span>getStats<span class="signature">()</span><span class="type-signature"> &rarr; {Promise}</span></h4>
    

    















<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="display_api.js.html">display/api.js</a>, <a href="display_api.js.html#line765">line 765</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    A promise this is resolved with current statistics about
  document structures (see PDFDocumentStats).
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Promise</span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id="getViewerPreferences"><span class="type-signature"></span>getViewerPreferences<span class="signature">()</span><span class="type-signature"> &rarr; {Promise}</span></h4>
    

    















<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="display_api.js.html">display/api.js</a>, <a href="display_api.js.html#line675">line 675</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    A promise that is resolved with an {Object} containing
  the viewer preferences.
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Promise</span>


    </dd>
</dl>

    





        
    

    

    
</article>

</section>




</div>

<nav>
    <h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-pdfjsLib.html">pdfjsLib</a></li></ul><h3>Externals</h3><ul><li><a href="external-Promise.html">Promise</a></li></ul><h3>Classes</h3><ul><li><a href="module-pdfjsLib-PDFDataRangeTransport.html">PDFDataRangeTransport</a></li><li><a href="module-pdfjsLib-PDFDocumentLoadingTask.PDFDocumentLoadingTask.html">PDFDocumentLoadingTask</a></li><li><a href="module-pdfjsLib-PDFDocumentProxy.html">PDFDocumentProxy</a></li><li><a href="module-pdfjsLib-PDFWorker.PDFWorker.html">PDFWorker</a></li><li><a href="PDFPageProxy.html">PDFPageProxy</a></li><li><a href="RenderTask.html">RenderTask</a></li></ul>
</nav>

<br class="clear">

<footer>
    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a> on Fri Dec 13 2019 22:39:31 GMT+0000 (Greenwich Mean Time)
</footer>

<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>